package com.evil.common.es.dto.application.order.node;

import com.evil.common.es.dto.application.order.ESOrderDataDTO;
import com.evil.common.es.util.ESFieldUtil;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

/**
 * 节点处理人
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
@Data
public class ESNodeHandlerDTO {

    /**
     * 节点id
     */
    @NotNull
    @Field(name = COL_NODE_ID, type = FieldType.Long)
    private Long nodeId;
    public static final String COL_NODE_ID = "node_id";
    public static final String COL_NODE_HANDLERS_NODE_ID = ESFieldUtil.join(ESOrderDataDTO.COL_NH, COL_NODE_ID);
    public static final String COL_NODE_HANDLERS_NESTED_NODE_ID = ESFieldUtil.join(ESOrderDataDTO.COL_NHN, COL_NODE_ID);

    /**
     * 处理人
     */
    @NotNull
    @Field(name = COL_HANDLER_ID, type = FieldType.Long)
    private Long handlerId;
    public static final String COL_HANDLER_ID = "handler_id";
    public static final String COL_NODE_HANDLERS_HANDLER_ID = ESFieldUtil.join(ESOrderDataDTO.COL_NH, COL_HANDLER_ID);
    public static final String COL_NODE_HANDLERS_NESTED_HANDLER_ID = ESFieldUtil.join(ESOrderDataDTO.COL_NHN, COL_HANDLER_ID);

    /**
     * 处理人分组
     */
    @NotNull
    @Field(name = COL_HANDLER_GROUP, type = FieldType.Keyword)
    private String handlerGroup;
    public static final String COL_HANDLER_GROUP = "handler_group";
    public static final String COL_NODE_HANDLERS_HANDLER_GROUP = ESFieldUtil.joinKeyword(ESOrderDataDTO.COL_NH, COL_HANDLER_GROUP);
    public static final String COL_NODE_HANDLERS_NESTED_HANDLER_GROUP = ESFieldUtil.joinKeyword(ESOrderDataDTO.COL_NHN, COL_HANDLER_GROUP);

    /**
     * 处理类型
     */
    @NotNull
    @Field(name = COL_HANDLE_TYPE, type = FieldType.Integer)
    private Integer handleType;
    public static final String COL_HANDLE_TYPE = "handle_type";
    public static final String COL_NODE_HANDLERS_HANDLE_TYPE = ESFieldUtil.join(ESOrderDataDTO.COL_NH, COL_HANDLE_TYPE);
    public static final String COL_NODE_HANDLERS_NESTED_HANDLE_TYPE = ESFieldUtil.join(ESOrderDataDTO.COL_NHN, COL_HANDLE_TYPE);

    /**
     * 处理时间
     */
    @Field(name = COL_HANDLE_DATE, type = FieldType.Date)
    private Date handleDate;
    public static final String COL_HANDLE_DATE = "handle_date";
    public static final String COL_NODE_HANDLERS_HANDLE_DATE = ESFieldUtil.join(ESOrderDataDTO.COL_NH, COL_HANDLE_DATE);
    public static final String COL_NODE_HANDLERS_NESTED_HANDLE_DATE = ESFieldUtil.join(ESOrderDataDTO.COL_NHN, COL_HANDLE_DATE);

    /**
     * 备注
     */
    @Field(name = COL_REMARK, type = FieldType.Text)
    private String remark;
    public static final String COL_REMARK = "remark";
    public static final String COL_NODE_HANDLERS_REMARK = ESFieldUtil.join(ESOrderDataDTO.COL_NH, COL_REMARK);
    public static final String COL_NODE_HANDLERS_NESTED_REMARK = ESFieldUtil.join(ESOrderDataDTO.COL_NHN, COL_REMARK);
}
